/*
 * GalaxyView.h
 *
 *  Created on: 2011-5-5
 *      Author: Administrator
 */

#ifndef GALAXYVIEW_H_
#define GALAXYVIEW_H_

#include <FBase.h>
#include <FUi.h>
#include "GalaxyThread.h"
#include "Background.h"

class GalaxyThread;

namespace Galaxy{
class GalaxyView :
	public Osp::Ui::Controls::Form,
	public Osp::Ui::IActionEventListener,
	public Osp::Ui::ITouchEventListener{
public:
	GalaxyView();
	virtual ~GalaxyView();
	bool Initialize(void);
public:
	virtual result OnInitializing(void);
	virtual result OnTerminating(void);
	virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
	virtual result OnDraw();

public:
	virtual void OnTouchPressed(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo & touchInfo);
	virtual void OnTouchLongPressed(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchReleased(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchMoved(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchDoublePressed(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchFocusIn(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);
	virtual void OnTouchFocusOut(const Osp::Ui::Control& source,
		const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo& touchInfo);

public:
	GalaxyThread* GetThread();

private:
	//Own
	GalaxyThread* __pThread;
};
}


#endif /* GALAXYVIEW_H_ */
